acip=`cat /tmp/acip`
url="http://$acip:80/"
filename=$1
cd /tmp
wget "$url$filename"
ver=`cat /etc/APmode |cut -c1-4`

if [ "$ver" \< "$2" ]; then
	echo "need to upgrade"
	mv $filename SYSUP.tar.gz
	tar -zxvf SYSUP.tar.gz
	md51=`md5sum $filename | awk -F ' ' ' {print $1}'` 
	md52=`cat md5.txt`
	length=${#md51}
	if [ $length != "0" ]; then
		if [ "$md51" == "$md52" ]; then
			sysupgrade -n $filename
		fi
	fi
else
	echo "no need to upgrade"
fi

